﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Supermarket.Web.CashierPages.Inquires
{
    public partial class CategoryProductsInStock : System.Web.UI.Page
    {
        private decimal totalSum = 0m;

        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void GridViewProducts_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                totalSum += (decimal)double.Parse(e.Row.Cells[4].Text);
            }
            if (e.Row.RowType == DataControlRowType.Footer)
            {
                e.Row.Cells[4].Text = String.Format("Общо: {0:0.00} лв.", totalSum);
            }
        }
    }
}